{template header}
{php doAction('tseditor','mini')}
<div class="midder">
<div class="mc">

<div class="cleft">
<div class="bbox">

<div class="bd"><a href="{tsUrl('group')}" title="小组">小组</a> → <a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup['groupname']}</a> → {$strTopic[title]}</div>

<h1>{if $strTopic[typeid] !='0'}<a href="{tsUrl('group','show',array('id'=>$strTopic[groupid],typeid=>$strTopic[typeid]))}">[{$strTopic[type][typename]}]</a>{/if}{$strTopic[title]} {if $strTopic['postby']==1}<a href="{tsUrl('home','phone')}"><img align="absmiddle" alt="通过Iphone手机端发布" title="通过Iphone手机端发布" src="{SITE_URL}public/images/ios.jpg" /></a>{/if}</h1>

<div class="bc">
{if $page == '1'}
<div class="topic-content">
<div class="user-face">
<a href="{tsUrl('user','space',array('id'=>$strTopic[user][userid]))}"><img title="{$strTopic[user][username]}" alt="{$strTopic[user][username]}" src="{$strTopic[user][face]}" width="48" height="48"></a>
</div>

<div class="topic-doc">

<h3>来自: <a href="{tsUrl('user','space',array('id'=>$strTopic[userid]))}">{$strTopic[user][username]}</a>
 {php echo date('Y-m-d H:i:s',$strTopic[addtime])} </h3>

<div class="topic-view">

{if $strTopic['after']}
<ul class="title2">
{loop $strTopic['after'] $key $item}
{if $item['title']}
<li><a href="#title{$item[id]}">{$item['title']}</a></li>
{/if}
{/loop}
</ul>
{/if}
{$strTopic[content]}
</div>

{if $TS_USER[user][userid] == $strTopic[userid] || $TS_USER[user][userid]==$strGroup[userid] ||$strGroupUser[isadmin]=="1" || $TS_USER[user][isadmin]=="1"}
<p class="btool">
{if $TS_USER[user][userid]==$strGroup[userid] ||$strGroupUser[isadmin]=="1" || $TS_USER[user][isadmin]=="1"}

<a href="javascript:void('0');" onclick="topicAudit('{$strTopic['topicid']}');">{if $strTopic['isaudit']=='1'}审核{else}取消审核{/if}</a> 

<a href="{SITE_URL}index.php?app=group&ac=do&ts=topic_istop&topicid={$strTopic[topicid]}">{if $strTopic[istop]=='0'}置顶{else}取消置顶{/if}</a> 

<a href="{SITE_URL}index.php?app=group&ac=do&ts=isposts&topicid={$strTopic[topicid]}&token={$_SESSION['token']}">{if $strTopic[isposts]==0}精华{else}取消精华{/if}</a>

<a href="{SITE_URL}index.php?app=group&ac=topicmove&topicid={$strTopic[topicid]}">移动</a>

{/if}
<a href="{SITE_URL}index.php?app=group&ac=topicedit&topicid={$strTopic[topicid]}">编辑</a> 
<a href="{SITE_URL}index.php?app=group&ac=do&ts=deltopic&topicid={$strTopic['topicid']}&token={$_SESSION['token']}" onClick="return confirm('确定删除吗?')">删除</a>

</p>
{/if}


{loop $strTopic['after'] $key $item}
{if $item['title']}
<h4><a name="title{$item['id']}"></a>{$item['title']}</h4>
{/if}
<div class="after-view">
{$item['content']}
{if  $item['userid'] == $TS_USER['user']['userid'] || $TS_USER['user']['isadmin']==1}
<br />
<p class="btool">
<a href="{tsUrl('group','after',array('ts'=>'edit','aid'=>$item['id']))}">编辑</a>
<a href="{tsUrl('group','after',array('ts'=>'delete','aid'=>$item['id']))}" onClick="return confirm('确定删除吗？')">删除</a>
 <a href="{tsUrl('group','after',array('ts'=>'up','afterid'=>$item['id']))}" onClick="return confirm('确定上移?')">上移</a>
<a href="{tsUrl('group','after',array('ts'=>'down','afterid'=>$item['id']))}" onClick="return confirm('确定下移?')">下移</a> 
</p>
{/if}
</div>
{/loop}
<div class="clear"></div>
{if $strTopic['userid'] == $TS_USER['user']['userid'] || $TS_USER['user']['isadmin']==1}
<p class="bltool">
<a href="{tsUrl('group','after',array('topicid'=>$strTopic['topicid']))}">补贴</a>
</p>
{/if}
{php doAction('gobad','468')}
</div>
</div>
<div class="clear"></div>

<div class="tar">
<a class="btn" href="javascript:void('0');" onclick="taoalbum('{$strTopic['topicid']}')">淘贴</a> 
<a id="topiclove" class="btn" href="javascript:void('0');" onclick="loveTopic('{$strTopic['topicid']}')">{$strTopic['count_love']}喜欢</a>
<a class="btn" href="">{$strTopic['count_comment']}评论</a>
</div>

<div class="clear"></div>


<div class="tags">
{loop $strTopic[tags] $key $item}
<a rel="tag" title="" class="post-tag" href="{tsUrl('group','tag',array('id'=>urlencode($item[tagname])))}">{$item[tagname]}</a>
{/loop}

</div>
{/if}
</div>
</div>

<div class="bbox">
<h2>用户评论({$strTopic['count_comment']})</h2>
<div class="bc">
<ul class="comment">
{if is_array($arrTopicComment)}
{loop $arrTopicComment $key $item}
<li class="clearfix" id="l_{$item[commentid]}">
<div class="user-face">
<a href="{tsUrl('user','space',array('id'=>$item[user][userid]))}" rel="face" uid="$item[user][userid]"><img title="{$item[user][username]}" alt="{$item[user][username]}" src="{$item[user][face]}" width="48" /></a>
</div>
<div class="reply-doc">
<h4>{php echo date('Y-m-d H:i:s',$item[addtime])}
	<a href="{tsUrl('user','space',array('id'=>$item[user][userid]))}" rel="face" uid="$item[user][userid]" style="margin-left:5px; margin-right:5px;">{$item[user][username]}</a>
    <i>$item[l]#</i>
</h4>


{if $item[referid] !='0'}
<div class="recomment"><a href="{tsUrl('user','space',array('id'=>$item[recomment][user][userid]))}"><img src="{$item[recomment][user][face]}" width="24" align="absmiddle"></a> <strong><a href="{tsUrl('user','space',array('id'=>$item[recomment][user][userid]))}" rel="face" uid="$item[recomment][user][userid]">{$item[recomment][user][username]}</a></strong>：{$item[recomment][content]}</div>
{/if}
<p>
{$item[content]}
</p>

<div class="tar">
{if $strGroupUser}
<span><a href="javascript:void(0)"  onclick="commentOpen({$item[commentid]},{$item[topicid]})">回复</a></span>
{/if}

{if $TS_USER[user][userid] == $strGroup[userid] || $TS_USER[user][userid] == $item[userid] || $strGroupUser[isadmin]==1 || $TS_USER[user][isadmin]==1}
<span><a class="j a_confirm_link" href="{SITE_URL}index.php?app=group&ac=comment&ts=delete&commentid={$item[commentid]}&token={$_SESSION['token']}" rel="nofollow" onClick="return confirm('确定删除吗?')">删除</a>
</span>
{/if}
</div>


<div id="rcomment_{$item[commentid]}" style="display:none">
<textarea style="width:90%;height:60px;font-size:14px;" id="recontent_{$item[commentid]}" type="text" onKeyDown="keyRecomment({$item[commentid]},{$item[topicid]},event)"></textarea>

<p><a class="btn" href="javascript:void(0);" onClick="recomment({$item[commentid]},{$item[topicid]})" id="recomm_btn_$item[commentid]">提交</a> <a href="javascript:void('0');" onclick="commentOpen({$item['commentid']},{$item['topicid']})">取消</a></p>
</div>
</div>
<div class="clear"></div>
</li>
{/loop}
{/if}
</ul>
<div class="page">{$pageUrl}</div>


<div>
{if intval($TS_USER[user][userid])==0}
<div class="tac pd20">
<a href="{tsUrl('user','login')}">登陆</a> | <a href="{tsUrl('user','register')}">注册</a>
</div>
{elseif $strGroupUser==''}
<div class="tac pd20">
不是本组成员不能回应此贴哦
</div>
{elseif $strTopic[iscomment] == 1 && $strTopic[userid] != $TS_USER[user][userid]}
<div class="tac pd20">
本帖除作者外不允许任何人评论
</div>
{elseif $strTopic[isclose]=='1'}
<div class="tac pd20">
该帖子已被关闭，无法评论
</div>
{else}
<form method="POST" action="{SITE_URL}index.php?app=group&ac=comment&ts=do" enctype="multipart/form-data">
<textarea type="text" style="width:100%;" id="tseditor-mini" name="content"></textarea>
<p>
<input type="hidden" name="topicid" value="{$strTopic[topicid]}" />
<input type="hidden" name="token" value="{$_SESSION['token']}" />

验证码：<input name="authcode" />
 <img align="absmiddle" src="{tsUrl('pubs','code')}" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
<br />
<button class="btn btn-success" type="submit">提交评论</button></p>
</form>
{/if}
</div>

</div>
</div>


</div>

<div class="cright">

<div class="bbox">

<div class="bc">><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">返回{$strGroup['groupname']}</a></div>
	
</div>

<div class="bbox">
<h2>最新帖子</h2>
<div class="bc commlist">
<ul>
{loop $newTopic $key $item}
<li>
{if $item['appkey'] != 'group' && $item['appkey']!=''}
<a target="_blank" style="color:#999999;font-size: 12px;margin-right: 5px;" class="titles-type" href="{SITE_URL}{php echo tsUrl($item['appkey'])}">[{$item['appname']}]</a>
<a title="{$item[title]}" href="{SITE_URL}{php echo tsUrl($item['appkey'],$item['appaction'],array('id'=>$item['askid']))}">{$item[title]}</a>
{else}
<a title="{$item[title]}" href="{tsUrl('group','topic',array('id'=>$item[topicid]))}">{php echo cututf8($item[title],0,25)}</a> 
{/if}

</li>
{/loop}
</ul>
</div>
</div>

<div class="bbox"><h2>热门帖子</h2>

<div class="bc commlist">
<ul>
{loop $arrHotTopic $key $item}
<li><a href="{tsUrl('group','topic',array('id'=>$item['topicid']))}">{$item['title']}</a></li>
{/loop}
</ul>
</div>

</div>


<div class="bbox"><h2>喜欢这个帖子的用户</h2>
<div class="bc" id="collects">
<div style="padding:10px;text-align:center;"><img src="{SITE_URL}public/images/loading.gif" />加载中......</div>
</div>
</div>

<div class="clear"></div>
<!--广告位-->
{php doAction('gobad','300')}
</div>

</div>
</div>

<script>
//谁收藏了这个帖子
var url = siteUrl+"index.php?app=group&ac=topiccollect&ts=ajax&topicid={$strTopic['topicid']}";
$.post(url,function(rs){ $('#collects').html(rs); });
</script>

{template footer}